package org.example.seata.bs.order.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.example.seata.bs.api.entity.order.OrderInfo;
import org.example.seata.bs.api.service.order.impl.OrderInfoServiceImpl;
import org.example.seata.bs.order.service.OrderInfoEnhanceService;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author hzq
 * @date 2021/12/1 11:23
 */
@Service
@Primary
@DS("order")
public class OrderInfoEnhanceServiceImpl extends OrderInfoServiceImpl implements OrderInfoEnhanceService {

    @Override
    public List<OrderInfo> listByOrderId(Integer orderId) {
        LambdaQueryWrapper<OrderInfo> wrapper = Wrappers.<OrderInfo>lambdaQuery()
                .eq(OrderInfo::getOrderId, orderId);
        return list(wrapper);
    }
}
